import React,{Component} from "react"
import $ from "jquery"
// import Animate from 'rc-queue-anim'
import Answer from "./Answer.js"
export default class Comment extends Component {
	constructor(props){
		super(props)
		this.state={
			
		}
	}
	
	//点击评论人跳转到其他用户页面
	otheruser(){
		let username=this.props.comment.commentUserName
		window.location="/user/"+username
	}
	render(){
		return (
			<div>
	             <p key={this.props.comment.commentUserName}><span style={{color:"blue",cursor:"pointer"}} onClick={(e)=>this.otheruser(e)}>{this.props.comment.commentUserName}</span>: <span style={{cursor:"pointer"}}>{this.props.comment.commentContent}</span></p>
				{this.props.comment.answer?this.props.comment.answer.map((val,index)=>{
					if(!val) return ;
					return (< Answer answer={val} key={index} commentusername={this.props.comment.commentUserName}/>)
				}):""}
	         </div>
		)
	}
}